package com.ms.education.order.mapper;

import com.ms.education.constant.OrderConstant;
import com.ms.education.order.entity.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.MapKey;
import org.springframework.data.repository.query.Param;

import java.util.concurrent.TimeUnit;

/**
 * <p>
 * 订单 Mapper 接口
 * </p>
 *
 * @author ms
 * @since 2023-02-16
 */
public interface OrderMapper extends BaseMapper<Order> {

    /**
     * 删除过期且没有支付的订单
     *
     * @param expiredTime 过期时间
     * @param status      配置中定义未支付状态的值
     * @return 删除的个数
     */
    int deleteExpiredOrder(@Param("expiredTime") int expiredTime, @Param("status") Integer status);

}
